namespace BB.Apostas.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class v8 : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.Classificacaos", "UserId", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "CompeticaoId", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "JornadaId", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "W", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "D", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "L", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "GF", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "GA", c => c.Int(nullable: false));
            AddColumn("dbo.Classificacaos", "Score", c => c.Int(nullable: false));
            AddForeignKey("dbo.Classificacaos", "UserId", "dbo.UserProfile", "UserId", cascadeDelete: true);
            AddForeignKey("dbo.Classificacaos", "CompeticaoId", "dbo.Competicaos", "Id", cascadeDelete: true);
            AddForeignKey("dbo.Classificacaos", "JornadaId", "dbo.Jornadas", "Id", cascadeDelete: true);
            CreateIndex("dbo.Classificacaos", "UserId");
            CreateIndex("dbo.Classificacaos", "CompeticaoId");
            CreateIndex("dbo.Classificacaos", "JornadaId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.Classificacaos", new[] { "JornadaId" });
            DropIndex("dbo.Classificacaos", new[] { "CompeticaoId" });
            DropIndex("dbo.Classificacaos", new[] { "UserId" });
            DropForeignKey("dbo.Classificacaos", "JornadaId", "dbo.Jornadas");
            DropForeignKey("dbo.Classificacaos", "CompeticaoId", "dbo.Competicaos");
            DropForeignKey("dbo.Classificacaos", "UserId", "dbo.UserProfile");
            DropColumn("dbo.Classificacaos", "Score");
            DropColumn("dbo.Classificacaos", "GA");
            DropColumn("dbo.Classificacaos", "GF");
            DropColumn("dbo.Classificacaos", "L");
            DropColumn("dbo.Classificacaos", "D");
            DropColumn("dbo.Classificacaos", "W");
            DropColumn("dbo.Classificacaos", "JornadaId");
            DropColumn("dbo.Classificacaos", "CompeticaoId");
            DropColumn("dbo.Classificacaos", "UserId");
        }
    }
}
